package com.imooc.miaosha.result;

import lombok.Getter;

@Getter
public enum Const {
    SUCCESS(0, "success"),
    SERVER_ERROR(500100, "服务端异常"),
    BIND_ERROR(500101, "参数校验异常：%s"),

    SESSION_ERROR(500210, "Session不存在或者已经失效"),
    PASSWORD_EMPTY(500211, "登录密码不能为空"),
    MOBILE_NULL(500212, "手机号不能为空"),
    MOBILE_ERROR(500213, "手机号格式错误"),
    MOBILE_NOT_EXIST(500214, "手机号不存在"),
    PASSWORD_ERROR(500215, "密码错误"),

    ORDER_NOT_EXIST(500216, "订单不存在或者该订单不属于你"),

    MIAO_SHA_OVER(500500, "商品已经秒杀完毕"),
    REPEATE_MIAOSHA(500501, "不能重复秒杀"),
    MIAOSHA_PATH_ERROR(500502, "秒杀地址不正确"),
    MIAOSHA_VERIFY_CODE_ERROR(500503, "验证码不正确"),
    ACCESS_LIMIT_REACHED(500504, "访问次数太频繁!");


    private int code;
    private String msg;

    Const(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "Const [code=" + code + ", msg=" + msg + "]";
    }


}
